home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-09-15 | 10.9 KB | 282 lines | [TEXT/MPS ] |
- ;---------------------------------------------------------------------------------------
- ;
- ;File: ExROM1Fun.a
- ;Dev system: MPW 3.0
- ;By: MacDTS
- ;Date: 8/08/89
- ;
- ; This is a very small sample declaration ROM with the required board
- ; sResource and a functional sResource (which is blank).
- ; The board id and functional sResource types are especially bogus - your values
- ; must be obtained from MacDTS, after sending in the required information.
- ; Anyway, this file shows how to put together a ROM. You also need
- ; the Cards and Drivers book, with the source code for a ROM and driver.
- ; Both are stripped down versions of the Apple Macintosh Video card ROM and
- ; video driver aka the TFB board. There are also other examples and exploded
- ; drawings of declaration ROMs on the Developer Helper CD. Volume one is
- ; known as "Phil and Dave's Excellent CD". The examples, tools, and drawings are
- ; also on AppleLink. To get to them, go into (in order):
- ;
- ; Developer Services bulletin board icon
- ; Developer Technical Support folder
- ; Macintosh folder
- ; Tools folder
- ; Card Dev tools folder
- ;
- ;
- ; In the Card Dev Tools folder are other folders containing tools and
- ; libraries. These include:
- ;
- ; Examples folder - contains example declaration ROMs, video driver,
- ; source to a program like the GetsInfo program found
- ; in the Slot Tools folder
- ; Gamma Information folder - contains documention discussing gamma table format.
- ; This will be updated in later documentation for the
- ; new 32-bit QuickDraw. Eventually, the Cards and
- ; Drivers book will contain the new gamma information,
- ; NuBusTester folder - contains a library to detect new ROMs with fixed
- ; Slot Manager (Slot Manager that runs in 32-bit mode
- ; as opposed to 24-bit mode)
- ; Training Tools folder - contains MacDraw drawings of exploded
- ; configuration ROMs (like the existing Apple video
- ; card ROM and the Apple EtherNet board ROM.
- ;
- ; Slot tools folder - Inside, you'll find these tools:
- ;
- ; CRCPatch - MPW tool that calculates and patches in
- ; the crc value of the assembled Declaration ROM file.
- ;
- ; Data - MPW tool takes the assembled file and strips
- ; off the code 0 segment,leaving the code 1 segment
- ; (the raw code). The resulting file can then be
- ; downloaded to a rom burning machine.
- ;
- ; Tjscomm - A small terminal program that can be used
- ; to download the data file to a rom burning machine.
- ;
- ; SlotMgrTst - application that excersises the slot
- ; manager by making slot manager calls
- ;
- ; GetsInfo - application that displays sResources and
- ; other configuration ROM information
- ;
- ; Disclaimer: the above may be reorganized at any time, or changed via additions
- ; and deletions.
- ;
- ;
- ; The general structure of this example ROM is:
- ;
- ; [Format/Header]
- ; |
- ; |
- ; [sResource Directory]
- ; / \
- ; / \
- ; / \
- ; / \
- ; [Board sResource] [Functional sResource]
- ; - Primary Init. - Driver Directory.
- ; - board id
- ; - Vendor Info.
- ;
- ;
- ; If you want to print this, I suggest using landscape mode!!!
- ;
- ;-------------------------------------------------------------------
-
- MACHINE MC68020
-
- ;=====================================================================
- ; Initial Assembler Directives
- ;=====================================================================
- PRINT OFF
- STRING C
- ;Note - File names changed
- ;since example in C & D
- ;book was published.
- INCLUDE 'SysErr.a' ;Macintosh error equates
- INCLUDE 'SysEqu.a' ;Macintosh System equates
- INCLUDE 'ROMEqu.a' ;Declaration ROM equates
- INCLUDE 'SlotEqu.a' ;Slot Manager equates and macros
- INCLUDE 'TimeEqu.a' ;Macintosh traps
- INCLUDE 'Traps.a' ;Macintosh traps
- PRINT ON
-
- ;
- ;=====================================================================
- ; BEGIN Declaration ROM
- ;=====================================================================
- SampleDeclROM MAIN
-
-
-
- ;*************************************************************
- ; Constants
- ;*************************************************************
-
- ROMSize EQU $1000 ;4K byte ROM in this example
- TheBoardId EQU $ABCD ;the Board Id (DON'T USE
- ; THIS-GET from DTS!)
-
- ;board sResource equates
- ;the following two lines are
- ;catBoard EQU 1 ;commented out since the equates
- ;TypeBoard EQU 0 ;are already defined in ROMEqu.a
- DrSwBoard EQU 0 ;NOT in ROMEqu.a, define it here
- DrHwBoard EQU 0 ;NOT in ROMEqu.a, define it here
-
- CatExCat EQU $6666 ;Functional sResource sRsrc_Type
- TypExTyp EQU $7777 ;equates. THESE ARE EXAMPLES
- DrSwExSw EQU $8888 ;ONLY! DON'T USE THESE VALUES
- DrHwExHw EQU $9999 ;GET THEM FROM DTS!!
-
- ;Example values-vendors
- ;should modify as needed
- defMinorBase EQU 0 ;RAM Offset is 0
- defMinorLength EQU $40000 ;RAM length is $40000
-
- ;----------- sResource Directory ;<Id OF>
- sRsrcBoard EQU 1 ;Board sResource {May be any
- ;number in [0..127]}
- sRsrcFun EQU 128 ;functional sResource {May be
- ;any number in [128..254]}
-
-
- ;=====================================================================
- ; Directory
- ;=====================================================================
- _sRsrcDir OSLstEntry sRsrcBoard,_sRsrcBoard ;References board sResource.
- OSLstEntry sRsrcFun,_sRsrcFun ;References functional sResource.
- DatLstEntry endOfList,0 ;End of the list.
-
-
- ;=============================================================
- ; The Board sResource
- ;=============================================================
- _sRsrcBoard OSLstEntry sRsrcType,_BoardType ;References Rsrc_Type entry
- OSLstEntry sRsrcName,_BoardName ;References Rsrc_Name entry
- DatLstEntry boardId,TheBoardId ;boardId **ASSIGNED BY MACDTS**
- OSLstEntry primaryInit,_sPInitRec ;References Primary init record.
- OSLstEntry vendorInfo,_VendorInfo ;References Vendor info list.
- DatLstEntry endOfList,0 ;End of the list.
-
- ;Rsrc_Type IS ALWAYS THE SAME
- ;for the board sResource
- ;(but varies with different
- ;functional sResources)
- _BoardType DC.W CatBoard ;ALWAYS $0001 for bd sResource
- DC.W TypBoard ;ALWAYS $0000 for bd sResource
- DC.W DrSwBoard ;ALWAYS $0000 for bd sResource
- DC.W DrHwBoard ;ALWAYS $0000 for bd sResource
- _BoardName DC.L 'OFFICIAL PRODUCT NAME' ;The name of the Board - should
- ;be official product name
-
-
- ;-------------------------------------------------------------
- ; Primary Init Record (if needed)
- ;-------------------------------------------------------------
- _sPInitRec DC.L _EndsPInitRec-_sPInitRec ;physical Block Size
- ; INCLUDE 'PrimaryInit.a' ;Primary Init Code
- _EndsPInitRec EQU * ;End of block
- STRING C ;Restore to 'c' string type.
-
-
- ;-------------------------------------------------------------
- ; Vendor Information record
- ;-------------------------------------------------------------
- ;** THE VENDOR INFO ENTRIES
- ;ARE DEFINED BY THE VENDOR, NOT
- ;BY MACDTS **
- _VendorInfo OSLstEntry VendorId,_VendorId ;References the Vendor Id.
- OSLstEntry RevLevel,_RevLevel ;References the Revision Level.
- OSLstEntry PartNum,_PartNum ;References the Part Number.
- DatLstEntry endOfList,0 ;End of the list.
-
- _VendorId DC.L 'COMPANY NAME' ;The Vendor Id. Most vendors use
- ;company name
- _RevLevel DC.L 'Release-1.0' ;The Revision Level
- _PartNum DC.L '12-3456' ;The Part Number
-
-
- ;=============================================================
- ; The Functional sResource
- ;=============================================================
- _sRsrcFun OSLstEntry sRsrcType,_FunType ;References sRsrc_Type
- OSLstEntry sRsrcName,_FunName ;References sRsrc_Name
- OSLstEntry sRsrcDrvrDir,_FunDrvrDir;References sResource driver dir
- DatLstEntry sRsrcHWDevId,1 ;The hardware device Id.
- OSLstEntry MinorBaseOS,_MinorBase ;References Minor Base Offset.
- OSLstEntry MinorLength,_MinorLength;References Minor Base Length.
- DatLstEntry endOfList,0 ;End of the list.
-
- ;sRsrc_Type labels for the
- ;Functional sResource; equates
- ;are assigned by MacDTS
- _FunType DC.W CatExCat ;<Category>
- DC.W TypExTyp ;<Type>
- DC.W DrSwExSw ;<DrSw>
- DC.W DrHwExHw ;<DrHw>
-
- _FunName DC.L 'ExCat_ExType_ExSW_ExHW' ;Convention: _FunName (the
- ;sRsrc_Name) is derived by using
- ;_FunType above, but stripping
- ;off the Cat, Typ, and DrSw/Hw
- ;prefixes, then separating the
- ;result by underscores. For
- ;instance, the Macintosh II video
- ;board has a functional sRsrc_Type
- ;of CatDisplay, TypVideo,
- ;DrSwApple, and DrHwTFB, so the
- ;resulting sRsrc_Name is
- ;Display_Video_Apple_TFB
-
- _MinorBase DC.L defMinorBase ;RAM Offset
- _MinorLength DC.L defMinorLength ;RAM length
- ;Note: often these card-specific
- ;equates are put in a separate
- ;dependant equates file (Apple
- ;puts the dependent equates for
- ;the video card in the file
- ;DepVidEqu.a for example). In
- ;order to keep all the equates
- ;for this example in one file, I
- ;put them at the top of this
- ;file. Note the values used
- ;here are just for example
- ;purposes.
-
-
- ;-------------------------------------------------------------
- ; Driver directory (if there's an on-board driver)
- ;-------------------------------------------------------------
- _FunDrvrDir OSLstEntry sMacOS68020,_sMacOS68020;References Macintosh-OS
- ;68020 driver.
- DatLstEntry endOfList,0 ;End of the list.
-
-
- ;Driver-1 (68020).
- _sMacOS68020 DC.L _End020Drvr-_sMacOS68020 ;The physical Block Size
- ; INCLUDE 'NameofDrvrSrcCodeFile.a' ;The driver code
- _End020Drvr EQU * ;The end of the driver.
- STRING C
-
-
-
-
- ORG ROMSize-FHeaderRec.fhBlockSize
- ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- ; Format/Header Block
- ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- DC.L (_sRsrcDir-*)**$00FFFFFF ;Offset to sResource directory
- DC.L ROMSize ;Length of declaration data
- DC.L 0 ;CRC-can be patched by MPW crc tool
- DC.B romRevision ;Revision level
- DC.B AppleFormat ;Format
- DC.L TestPattern ;Test pattern
- DC.B 0 ;Reserved byte (must be zero)
- DC.B $E1 ;ByteLanes: 1110 0001 (bytelane 0)
-
- ENDP
-
- END
-